//
//  VC3ScrollView.swift
//  ChapterAll
//
//  Created by Kevin on 2020/4/23.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VC3ScrollView: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let scrollview = UIScrollView(frame: view.frame)
        let img = UIImageView(image: UIImage(named: "tiger"))
        img.backgroundColor = UIColor.red
        
//        scrollview.bounces = false
//        scrollview.alwaysBounceVertical = true
//        scrollview.alwaysBounceHorizontal = false
        scrollview.scrollsToTop = true
        scrollview.isPagingEnabled = true
        scrollview.indicatorStyle = .black
        scrollview.showsVerticalScrollIndicator = false
        scrollview.showsHorizontalScrollIndicator = true
        scrollview.contentSize = CGSize(width: view.frame.width * 2, height: view.frame.height * 2)
        scrollview.addSubview(img)
        view.addSubview(scrollview)
    }
}
